package cn.iocoder.yudao.module.station.dal.mysql.cylinder;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.station.dal.dataobject.cylinder.CylinderDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.station.controller.admin.cylinder.vo.*;

/**
 * 钢瓶档案 Mapper
 *
 * @author 林子
 */
@Mapper
public interface CylinderMapper extends BaseMapperX<CylinderDO> {

    default PageResult<CylinderDO> selectPage(CylinderPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CylinderDO>()
                .eqIfPresent(CylinderDO::getCylinderCode, reqVO.getCylinderCode())
                .eqIfPresent(CylinderDO::getChipCode, reqVO.getChipCode())
                .eqIfPresent(CylinderDO::getQrcode, reqVO.getQrcode())
                .eqIfPresent(CylinderDO::getCylinderTypeCode, reqVO.getCylinderTypeCode())
                .eqIfPresent(CylinderDO::getCylinderModelCode, reqVO.getCylinderModelCode())
                .eqIfPresent(CylinderDO::getGasCylinderSpeci, reqVO.getGasCylinderSpeci())
                .betweenIfPresent(CylinderDO::getMakeTime, reqVO.getMakeTime())
                .eqIfPresent(CylinderDO::getServiceLife, reqVO.getServiceLife())
                .eqIfPresent(CylinderDO::getCheckPeriod, reqVO.getCheckPeriod())
                .betweenIfPresent(CylinderDO::getDesignScrapTime, reqVO.getDesignScrapTime())
                .eqIfPresent(CylinderDO::getTareWeight, reqVO.getTareWeight())
                .eqIfPresent(CylinderDO::getMaxFillWeight, reqVO.getMaxFillWeight())
                .eqIfPresent(CylinderDO::getUseRegisterStatus, reqVO.getUseRegisterStatus())
                .eqIfPresent(CylinderDO::getUseRegisterCode, reqVO.getUseRegisterCode())
                .betweenIfPresent(CylinderDO::getFillFirstTime, reqVO.getFillFirstTime())
                .eqIfPresent(CylinderDO::getRecentFillDeptCode, reqVO.getRecentFillDeptCode())
                .betweenIfPresent(CylinderDO::getRecentFillTime, reqVO.getRecentFillTime())
                .eqIfPresent(CylinderDO::getFillAmount, reqVO.getFillAmount())
                .eqIfPresent(CylinderDO::getRecentCheckStationCode, reqVO.getRecentCheckStationCode())
                .likeIfPresent(CylinderDO::getRecentCheckStationName, reqVO.getRecentCheckStationName())
                .betweenIfPresent(CylinderDO::getRecentCheckTime, reqVO.getRecentCheckTime())
                .eqIfPresent(CylinderDO::getRecentCheckBatchCode, reqVO.getRecentCheckBatchCode())
                .betweenIfPresent(CylinderDO::getRecentOperateTime, reqVO.getRecentOperateTime())
                .betweenIfPresent(CylinderDO::getNextCheckTime, reqVO.getNextCheckTime())
                .eqIfPresent(CylinderDO::getCylinderPics, reqVO.getCylinderPics())
                .eqIfPresent(CylinderDO::getCylinderStatus, reqVO.getCylinderStatus())
                .eqIfPresent(CylinderDO::getTransferFlag, reqVO.getTransferFlag())
                .eqIfPresent(CylinderDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CylinderDO::getLastNodeType, reqVO.getLastNodeType())
                .betweenIfPresent(CylinderDO::getLastFlowTime, reqVO.getLastFlowTime())
                .eqIfPresent(CylinderDO::getLastPosition, reqVO.getLastPosition())
                .eqIfPresent(CylinderDO::getWeightStatus, reqVO.getWeightStatus())
                .eqIfPresent(CylinderDO::getGasCylinderSpeciNum, reqVO.getGasCylinderSpeciNum())
                .eqIfPresent(CylinderDO::getStopId, reqVO.getStopId())
                .eqIfPresent(CylinderDO::getUseStatus, reqVO.getUseStatus())
                .betweenIfPresent(CylinderDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CylinderDO::getStationId, reqVO.getStationId())
                .eqIfPresent(CylinderDO::getBarcode, reqVO.getBarcode())
                .eqIfPresent(CylinderDO::getFactoryCode, reqVO.getFactoryCode())
                .likeIfPresent(CylinderDO::getFactoryName, reqVO.getFactoryName())
                .eqIfPresent(CylinderDO::getMediumCode, reqVO.getMediumCode())
                .likeIfPresent(CylinderDO::getMediumName, reqVO.getMediumName())
                .orderByDesc(CylinderDO::getId));
    }

    default List<CylinderDO> selectList(CylinderExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<CylinderDO>()
                .eqIfPresent(CylinderDO::getCylinderCode, reqVO.getCylinderCode())
                .eqIfPresent(CylinderDO::getChipCode, reqVO.getChipCode())
                .eqIfPresent(CylinderDO::getQrcode, reqVO.getQrcode())
                .eqIfPresent(CylinderDO::getCylinderTypeCode, reqVO.getCylinderTypeCode())
                .eqIfPresent(CylinderDO::getCylinderModelCode, reqVO.getCylinderModelCode())
                .eqIfPresent(CylinderDO::getGasCylinderSpeci, reqVO.getGasCylinderSpeci())
                .betweenIfPresent(CylinderDO::getMakeTime, reqVO.getMakeTime())
                .eqIfPresent(CylinderDO::getServiceLife, reqVO.getServiceLife())
                .eqIfPresent(CylinderDO::getCheckPeriod, reqVO.getCheckPeriod())
                .betweenIfPresent(CylinderDO::getDesignScrapTime, reqVO.getDesignScrapTime())
                .eqIfPresent(CylinderDO::getTareWeight, reqVO.getTareWeight())
                .eqIfPresent(CylinderDO::getMaxFillWeight, reqVO.getMaxFillWeight())
                .eqIfPresent(CylinderDO::getUseRegisterStatus, reqVO.getUseRegisterStatus())
                .eqIfPresent(CylinderDO::getUseRegisterCode, reqVO.getUseRegisterCode())
                .betweenIfPresent(CylinderDO::getFillFirstTime, reqVO.getFillFirstTime())
                .eqIfPresent(CylinderDO::getRecentFillDeptCode, reqVO.getRecentFillDeptCode())
                .betweenIfPresent(CylinderDO::getRecentFillTime, reqVO.getRecentFillTime())
                .eqIfPresent(CylinderDO::getFillAmount, reqVO.getFillAmount())
                .eqIfPresent(CylinderDO::getRecentCheckStationCode, reqVO.getRecentCheckStationCode())
                .likeIfPresent(CylinderDO::getRecentCheckStationName, reqVO.getRecentCheckStationName())
                .betweenIfPresent(CylinderDO::getRecentCheckTime, reqVO.getRecentCheckTime())
                .eqIfPresent(CylinderDO::getRecentCheckBatchCode, reqVO.getRecentCheckBatchCode())
                .betweenIfPresent(CylinderDO::getRecentOperateTime, reqVO.getRecentOperateTime())
                .betweenIfPresent(CylinderDO::getNextCheckTime, reqVO.getNextCheckTime())
                .eqIfPresent(CylinderDO::getCylinderPics, reqVO.getCylinderPics())
                .eqIfPresent(CylinderDO::getCylinderStatus, reqVO.getCylinderStatus())
                .eqIfPresent(CylinderDO::getTransferFlag, reqVO.getTransferFlag())
                .eqIfPresent(CylinderDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CylinderDO::getLastNodeType, reqVO.getLastNodeType())
                .betweenIfPresent(CylinderDO::getLastFlowTime, reqVO.getLastFlowTime())
                .eqIfPresent(CylinderDO::getLastPosition, reqVO.getLastPosition())
                .eqIfPresent(CylinderDO::getWeightStatus, reqVO.getWeightStatus())
                .eqIfPresent(CylinderDO::getGasCylinderSpeciNum, reqVO.getGasCylinderSpeciNum())
                .eqIfPresent(CylinderDO::getStopId, reqVO.getStopId())
                .eqIfPresent(CylinderDO::getUseStatus, reqVO.getUseStatus())
                .betweenIfPresent(CylinderDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CylinderDO::getStationId, reqVO.getStationId())
                .eqIfPresent(CylinderDO::getBarcode, reqVO.getBarcode())
                .eqIfPresent(CylinderDO::getFactoryCode, reqVO.getFactoryCode())
                .likeIfPresent(CylinderDO::getFactoryName, reqVO.getFactoryName())
                .eqIfPresent(CylinderDO::getMediumCode, reqVO.getMediumCode())
                .likeIfPresent(CylinderDO::getMediumName, reqVO.getMediumName())
                .orderByDesc(CylinderDO::getId));
    }

}
